package dao;

import util.DBHelper;

import java.util.Map;

public class AddressDao {
    public int addAddress(String uid,String receivername,String receiverphone,String receiverprovince,String receiveraddress,String status){
        String sql ="insert into receshopping values(default,?,?,?,?,?,1)";
        return DBHelper.update(sql,uid,receivername,receiverphone,receiverprovince,receiveraddress);
    }

    //获取默认地址
    public Map<String, Object> getDefaultAddress(String uid){
        String sql = "select * from receshopping where status ='0' and  uid = ?";
        return  DBHelper.selectOneMap(sql,uid);
    }
}
